<template>
    <div class="app-container">
        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>基本信息</span>
            </div>
            <el-form ref="form" :model="form" label-width="155px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="姓名" prop="nickName">
                            {{ this.form.nickName }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="部门归属" prop="deptId">
                            {{ getDeptByOrgId(this.form.deptId) }}
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="手机号" prop="phonenumber">
                            {{ this.form.phonenumber }}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="日分配数据量">
                            {{ form.receiveDaylimit }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="接收额度范围">
                            <el-select v-model="form.receiveContion" placeholder="不限额度" filterable clearable disabled>
                                <el-option label="不限额" value="0"></el-option>
                                <el-option label="3W内" value="1"></el-option>
                                <el-option label="5W内" value="2"></el-option>
                                <el-option label="10W内" value="3"></el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="客户数据总量限制">
                            {{ form.receiveTotallimit }}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="当前已分配数据量">
                            {{ dataStatic.day_received_count }}
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="是否接收公共池数据" prop="receiveCommon">
                            <el-radio-group v-model="form.receiveCommon">
                                <el-radio-button :label="1">接收</el-radio-button>
                                <el-radio-button :label="0">不接收</el-radio-button>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>


                    <el-col :span="8">
                        <el-form-item label="是否禁止登录" prop="status">
                            <el-radio-group v-model="form.status">
                                <el-radio-button :label="1">是</el-radio-button>
                                <el-radio-button :label="0">否</el-radio-button>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="是否开启自动抓取数据" prop="dataFetchPause">
                            <el-radio-group v-model="form.dataFetchPause">
                                <el-radio-button :label="1">是</el-radio-button>
                                <el-radio-button :label="0">否</el-radio-button>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="是否接收数据" prop="receiveNew">
                            <el-radio-group v-model="form.receiveNew">
                                <el-radio-button :label="1">接收</el-radio-button>
                                <el-radio-button :label="0">不接收</el-radio-button>
                            </el-radio-group>
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
        </el-card>

        <el-card class="box-card">
            <div slot="header" class="clearfix">
                <span>客户接收情况及业绩</span>
            </div>

            <el-form ref="form" :model="form" label-width="155px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="历史接收客户数">
                            {{ this.dataStatic.total_count }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="当前名下再分配数">
                            {{ this.dataStatic.cur_dist_count }}
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="当前名下新客户数">
                            {{ this.dataStatic.cur_data_count }}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="0星数据量">
                            {{ this.dataStatic.starlevel0_count }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="1星数据量">
                            {{ this.dataStatic.starlevel1_count }}
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="2星数据量">
                            {{ this.dataStatic.starlevel2_count }}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="3星数据量">
                            {{ this.dataStatic.starlevel3_count }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="4星数据量">
                            {{ this.dataStatic.starlevel4_count }}
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="5星数据量">
                            {{ this.dataStatic.starlevel5_count }}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="进件笔数">
                            {{ this.dataStatic.incoming_count }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="批款笔数">
                            {{ this.dataStatic.approve_count }}
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="批款金额">
                            {{ this.dataStatic.approve_amount }}
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="创收笔数">
                            {{ this.dataStatic.create_count }}
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="创收金额">
                            {{ this.dataStatic.create_amount }}
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>

        </el-card>
    </div>
</template>

<script>
import { getUserReport } from "@/api/crmsys/report/userCostStatics";

export default {
    data() {
        return {
            name: "TeamUserManagerStatics",
            // 表单参数
            form: {},
            dataStatic: {}
        }
    },
    // 生命周期 - 创建完成（访问当前this实例）
    created() {
        this.getInfo();
    },
    // 生命周期 - 挂载完成（访问DOM元素）
    mounted() {

    },
    // methods方法
    methods: {
        getInfo() {
            getUserReport({ userId: this.$store.state.user.id }).then((response) => {
                console.log(response);
                this.form = response.data.resMap[0];
                this.dataStatic = response.data.dataStaticMap[0];
            });
        }
    }
}
</script>

<style lang="scss" scoped>
@import '@/assets/styles/command.scss';
</style>

